/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bsc.ejb.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToMany;

/**
 *
 * @author memozac
 */
@Entity
@Inheritance(strategy=InheritanceType.JOINED )
public class Pointer extends ScoreCard implements Serializable {
    private static final long serialVersionUID = 1L;

    @OneToMany
    private Collection<Comparator> comparators;

    @OneToMany
    private Collection<DimensionalCut> dimesionalcuts;

    public Collection<Comparator> getComparators() {
        return comparators;
    }

    public void setComparators(Collection<Comparator> comparators) {
        this.comparators = comparators;
    }

    public Collection<DimensionalCut> getDimesionalcuts() {
        return dimesionalcuts;
    }

    public void setDimesionalcuts(Collection<DimensionalCut> dimesionalcuts) {
        this.dimesionalcuts = dimesionalcuts;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idScoreCard != null ? idScoreCard.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof Pointer)) {
            return false;
        }
        Pointer other = (Pointer) object;
        if ((this.idScoreCard == null && other.idScoreCard != null) || (this.idScoreCard != null && !this.idScoreCard.equals(other.idScoreCard))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "bsc.ejb.entity.Pointer[id=" + idScoreCard + "]";
    }

    @Override
    public int compareTo(Object o) {
        return getName().compareTo(((ScoreCard)o).getName());
    }
}//ends of class
